<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" th:href="@{/static/element/index.css}"/>
</head>
<body>
<style>
    .el-input-item {
        width: 260px;
    }

</style>
<div id="app">
    <template>
        <el-form :model="formData" ref="formData" :rules="rules" label-width="100px"
                 style="margin-top: 5%;display: flex;flex-direction: row;align-items: center;flex-wrap: wrap;justify-content: space-between;margin-right: 5%">
                                                                                                                                                                                <el-form-item label="邀请活动记录ID，关联到邀请活动表的ID" prop="inviteActivityId">
                                <el-input class="el-input-item" size="small" v-model="formData.inviteActivityId"
                                          placeholder="请输入邀请活动记录ID，关联到邀请活动表的ID"/>
                            </el-form-item>
                                                                                                                                                                                                                <el-form-item label="用户ID" prop="userId">
                                <el-input class="el-input-item" size="small" v-model="formData.userId"
                                          placeholder="请输入用户ID"/>
                            </el-form-item>
                                                                                                                                                                                                                <el-form-item label="奖品ID" prop="prizeId">
                                <el-input class="el-input-item" size="small" v-model="formData.prizeId"
                                          placeholder="请输入奖品ID"/>
                            </el-form-item>
                                                                                                                                                                                                                <el-form-item label="回放ID" prop="replayId">
                                <el-input class="el-input-item" size="small" v-model="formData.replayId"
                                          placeholder="请输入回放ID"/>
                            </el-form-item>
                                                                                                                                                                                                                <el-form-item label="奖品领取时间" prop="prizeGetTime">
                                <el-input class="el-input-item" size="small" v-model="formData.prizeGetTime"
                                          placeholder="请输入奖品领取时间"/>
                            </el-form-item>
                                                                                                                                                                                                                <el-form-item label="创建人ID" prop="createUserId">
                                <el-input class="el-input-item" size="small" v-model="formData.createUserId"
                                          placeholder="请输入创建人ID"/>
                            </el-form-item>
                                                                                                                                                                                                                                            <el-form-item label="更新人ID" prop="updateUserId">
                                <el-input class="el-input-item" size="small" v-model="formData.updateUserId"
                                          placeholder="请输入更新人ID"/>
                            </el-form-item>
                                                                                                            </el-form>
        <div style="text-align: center;margin-top: 5%">
            <el-button size="small" @click="closePage">取 消</el-button>
            <el-button size="small" type="primary" @click="handleSubmit">确 定</el-button>
        </div>
    </template>
</div>
</body>
<script th:src="@{/static/js/axios.min.js}"></script>
<script th:src="@{/static/js/request.js}"></script>
<script th:src="@{/static/js/common.js}"></script>
<script th:src="@{/static/api/admin/adminGetPrizeRecord.js}"></script>
<script th:src="@{/static/js/vue.min.js}"></script>
<script th:src="@{/static/element/index.js}"></script>
<script th:src="@{/static/js/jquery.min.js}"></script>
<script th:src="@{/static/layer/layer.js}"></script>
<script>
    let id = getQueryString("id");
    new Vue({
        el: '#app',
        data() {
            return {
                dialogVisible: false,
                formData: {},
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                rules: {
                                                                                                                                                                                inviteActivityId: [
                                {required: true, message: "邀请活动记录ID，关联到邀请活动表的ID不能为空", trigger: "blur"}
                            ],
                                                                                                                                                            userId: [
                                {required: true, message: "用户ID不能为空", trigger: "blur"}
                            ],
                                                                                                                                                            prizeId: [
                                {required: true, message: "奖品ID不能为空", trigger: "blur"}
                            ],
                                                                                                                                                                                                                                                                                                                                    }
            }
        },
        created() {
            if (id) {
                detail(id).then((res) => {
                    if (res.code === '200') {
                        this.formData = res.data
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    }
                });
            } else {
                this.formData = {}
            }
                                                                                                                                                                                                                                                                                                    
        },
        methods: {


            handleSubmit() {
                if (id) {
                    addOrUpdate('/admin/adminGetPrizeRecord/update', this);
                } else {
                    addOrUpdate('/admin/adminGetPrizeRecord/add', this);
                }
            },

                                                                                                                                                                                                                                                                                                            }
    });
</script>
</html>
